﻿using Antlr4.Runtime;
using System.Collections.Generic;
namespace FirstTest
{
    public class SpeakVisitor:SpeakBaseVisitor<object>
    {
        public class SpeakLine
        {
            public string Person;
            public string Text;
        }

        public List<SpeakLine> Lines = new List<SpeakLine>();


        public override object VisitLine(SpeakParser.LineContext context)
        {
            var name = context.name();
            var opinion = context.opinion();

            var line = new SpeakLine(){Person = name.GetText(), Text = opinion.GetText()};
            Lines.Add(line);
            return line;
        }
    }
}
